package com.sls.mall.auth.controller;

import com.sls.common.constant.AuthServerConstant;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;

@Controller
public class IndexController {

    @GetMapping({"/","/login.html"})
    public String loginPage(HttpSession session){
        Object attribute = session.getAttribute(AuthServerConstant.LOGIN_USER);
        if(attribute != null){
            return "redirect:http://www.slsmall.com";
        } else {
            return "login";
        }
    }
//
//    @GetMapping("/reg.html")
//    public String regPage(){
//        return "reg";
//    }
}
